home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / qbsub10.arc / FILTDMO.ASC < prev    next >
Encoding:
Text File  |  1986-06-25  |  2.4 KB  |  96 lines

  1. ' FILTDMO.ASC -- MSDOS QuickBASIC demo FILTER.SUB subroutines    25 June 86
  2. '        by David L. Poskie     (608) 274-9560
  3. '                  7118 Raymond Rd. Madison, WI 53719
  4. ' Please run any suggestions, corrections, additions, or changes by me.
  5. ' I can be messaged on all the major Madison, WI RBBS's.
  6.  
  7. GOTO Start
  8.     Rem    $Include: 'FILTER.SUB'
  9.     Rem    $Include: 'OMNI.SUB'
  10.  
  11. Start:
  12.     COLOR 14 , 3 , 8
  13.     CLS
  14.  
  15.     ' Print centered Text$, with top of frame at line 2.
  16.     X = 2                     'Set the starting line
  17.     FG = 11                    'Set the color of Text$
  18.     BG = 0                    'Set the background color
  19.     MG = 3                    'Set the color of sign frame
  20.     K.CODE = 8                'Set ASCII code of sign frame
  21.     Text$ = "Demonstration of the FILTER.SUB subroutines"
  22.     GOSUB SignCenter
  23.     PRINT
  24.  
  25.     ' Use the front filter to eliminate "**"
  26.     COLOR 11
  27.     Text$ = "> Front Filtering <"
  28.     GOSUB CenterPoint
  29.     COLOR 14
  30.  
  31.     ' Text$ is the target string
  32.     Text$ = "**FRONT FilterCheck"
  33.  
  34.     ' Show it before filtering
  35.     GOSUB CenterPoint
  36.  
  37.     ' We'll remove what's in Check$
  38.     Check$="**"
  39.     GOSUB FilterCheck
  40.  
  41.     ' Show result
  42.     GOSUB CenterPoint
  43.  
  44.     ' Use the tail filter to eliminate "##"
  45.     COLOR 11
  46.     Text$ = "> Tail Filtering <"
  47.     GOSUB CenterPoint
  48.     COLOR 14
  49.     Text$ = "FilterCheckTail##"
  50.     GOSUB CenterPoint
  51.     Check$= "##"
  52.     GOSUB FilterCheckTail
  53.     GOSUB CenterPoint
  54.  
  55.     ' Use the space/TAB filter to eliminate leading spaces and TABS
  56.     COLOR 11
  57.     Text$ = "> TAB Filtering <"
  58.     GOSUB CenterPoint
  59.     COLOR 14
  60.     ' Text$ contains two leading TABS
  61.     Text$ = "        2 LEADING TABS" 
  62.     GOSUB CenterPoint
  63.     GOSUB FilterSpaceTab
  64.     GOSUB CenterPoint
  65.  
  66.     COLOR 11
  67.     Text$ = "> Mixed Space & TAB Filtering <"
  68.     GOSUB CenterPoint
  69.     COLOR 14
  70.     ' Text$ contains a mix of leading TABS and spaces
  71.     Text$ = "                      MIXED SPACES & TABS"
  72.     GOSUB CenterPoint
  73.     GOSUB FilterSpaceTab
  74.     GOSUB CenterPoint
  75.  
  76.     ' Going to filter the front non-alphabetic characters
  77.     COLOR 11
  78.     Text$ = "> Front Non-alphabetic Filtering <"
  79.     GOSUB CenterPoint
  80.     COLOR 14
  81.     Text$ = "12345FILTER NUMBER 12345"
  82.     GOSUB CenterPoint
  83.     GOSUB FilterNonAlpha
  84.     GOSUB CenterPoint
  85.  
  86.     ' Going to filter the front alphabetic characters (any non-numeric)
  87.     COLOR 11
  88.     Text$ = "> Front Non-numeric Filtering <"
  89.     GOSUB CenterPoint
  90.     COLOR 14
  91.     Text$ = "ALPHA12345FILTER ALPHA"
  92.     GOSUB CenterPoint
  93.     GOSUB FilterNonNumeric
  94.     GOSUB CenterPoint
  95. SYSTEM
  96.